From: tsteven4 Date: Tue, 13 Nov 2018 15:30:46 +0000 (-0700) Subject: fix clazy detected 'Use *Ref() instead' X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~8^2~72^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=580fab85bf765e3944797bb37715c2428f535c00;p=gpsbabel.git fix clazy detected 'Use *Ref() instead' These are from -Wclazy-qstring-ref, and were automatically fixed. --- diff --git a/defs.h b/defs.h index 0ab96ff0f..4ea3ac1b9 100644 --- a/defs.h +++ b/defs.h @@ -1062,7 +1062,7 @@ case_ignore_strcmp(const QString& s1, const QString& s2) // In 95% of the callers, this could be s1.startsWith(s2)... inline int case_ignore_strncmp(const QString& s1, const QString& s2, int n) { - return s1.left(n).compare(s2.left(n), Qt::CaseInsensitive); + return s1.leftRef(n).compare(s2.left(n), Qt::CaseInsensitive); } int str_match(const char* str, const char* match); diff --git a/garmin_tables.cc b/garmin_tables.cc index a8241bb1a..40725087d 100644 --- a/garmin_tables.cc +++ b/garmin_tables.cc @@ -798,7 +798,7 @@ int gt_find_icon_number_from_desc(const QString& desc, garmin_formats_e garmin_f base = 7680; } if (base) { - n = desc.mid(7).toInt(); + n = desc.midRef(7).toInt(); return n + base; } } diff --git a/maggeo.cc b/maggeo.cc index 10f1b065f..00ad4cc60 100644 --- a/maggeo.cc +++ b/maggeo.cc @@ -192,9 +192,9 @@ maggeo_fmtdate(const QDateTime& dt) static QDateTime maggeo_parsedate(char* dmy) { QString date(dmy); - int d = date.mid(0,2).toInt(); - int m = date.mid(2,2).toInt(); - int y = date.mid(4,3).toInt(); + int d = date.midRef(0,2).toInt(); + int m = date.midRef(2,2).toInt(); + int y = date.midRef(4,3).toInt(); QDateTime r(QDate(y + 1900, m, d)); return r; } diff --git a/pcx.cc b/pcx.cc index 677c233fc..93ad85691 100644 --- a/pcx.cc +++ b/pcx.cc @@ -168,8 +168,8 @@ static void data_read() { wpt_tmp->longitude = lon; wpt_tmp->latitude = lat; } else { - lat = tbuf.mid(1, -1).toDouble(); - lon = nbuf.mid(1, -1).toDouble(); + lat = tbuf.midRef(1, -1).toDouble(); + lon = nbuf.midRef(1, -1).toDouble(); if (tbuf[0] == 'S') { lat = -lat; } @@ -241,8 +241,8 @@ static void data_read() { wpt_tmp->longitude = lon; wpt_tmp->latitude = lat; } else { - lat = tbuf.mid(1, -1).toDouble(); - lon = nbuf.mid(1, -1).toDouble(); + lat = tbuf.midRef(1, -1).toDouble(); + lon = nbuf.midRef(1, -1).toDouble(); if (tbuf[0] == 'S') { lat = -lat; }